  class ItemRecipe
    attr_accessor   :result
    attr_accessor   :list
    attr_accessor   :make_able_count
    def initialize(id)
      @result = $data_items[id]
      @list = []
      case id
        when 3
          @list.push(ItemRecipeBit.new($data_items[32], 1))
        when 4
          @list.push(ItemRecipeBit.new($data_items[32], 5))
        when 5
          @list.push(ItemRecipeBit.new($data_items[4], 2))
        when 6
          @list.push(ItemRecipeBit.new($data_items[32], 1))
          @list.push(ItemRecipeBit.new($data_items[35], 2))
      end
      GlobalMethods.addLog('init type=' + id.to_s + ", list size=" + @list.size.to_s)
      self.check_make_able_count
    end
    def check_make_able_count
      @make_able_count = 9999
      @list.each do |item|
        count = 0
        if item
          exist_number = $game_party.item_number(item.item.id)
          GlobalMethods.addLog("itemid=" + item.item.id.to_s + ", need=" + item.need_number.to_s + ", exist_number=" + exist_number.to_s);
          if exist_number > 0
            count = exist_number / item.need_number
            GlobalMethods.addLog("count=" + count.to_s);
          end
        end
        if count < @make_able_count
          @make_able_count = count
          GlobalMethods.addLog("make_able_count=" + @make_able_count.to_s);
        end
      end
    end
  end
